package com.example.kt_base.s5

//TODO 97.Kotlin语言的枚举定义函数

//四肢信息的class
class LimbsInfo(var limbsInfo:String, var length:Int){
    fun show() {
        println("${limbsInfo}的长度是：${length}")
    }

}
enum class Limbs(private val limbsInfo: LimbsInfo){
    LEFT_HAND(LimbsInfo("左手",66)),
    RIGHT_HAND(LimbsInfo("右手",66)),
    LEFT_FOOT(LimbsInfo("左脚",88)),
    RIGHT_FOOT(LimbsInfo("右脚",88));  //结束枚举值

    fun show()="四肢是：${limbsInfo.limbsInfo}的长度是：${limbsInfo.length}"

    fun updateData(limbsInfo: LimbsInfo){
        this.limbsInfo.limbsInfo=limbsInfo.limbsInfo
        this.limbsInfo.length=limbsInfo.length


    }
}
fun main() {
    println(Limbs.RIGHT_FOOT.show())

}
